package org.jeecg.modules.system.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.hepler.DingDingHelper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@Api(tags="发送消息到钉钉测试")
@RequestMapping("/ding/send/")
public class DingDingController {

    @Resource
    private DingDingHelper dingDingHelper;

    @GetMapping("/test")
    @ApiOperation(value = "发送数据到钉钉", notes = "发送数据到钉钉")
    public Result<?> test(String str){
        log.info("发送数据{}到钉钉",str);
        try {
            dingDingHelper.sendData(str,1);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Result.OK();
    }
}
